from Base.base import Base
from selenium.webdriver.common.by import By
class Login(Base):
    username_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[1]/div/input')

    def username(self,username):
        self.sendkeys(self.username_loc, username)

    password_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[2]/div/input')

    def password(self,password):
        self.sendkeys(self.password_loc, password)

    login_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div[1]/div[2]/button[2]')

    def login(self):
        self.click(self.login_loc)

    sure_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div[2]/div/div/div/div[2]/button[2]/span')

    def sureloc(self):
        self.click(self.sure_loc)

    def luoji_login(self):
        self.username('admin')
        self.password('admin')
        self.login()
        self.sureloc()
        self.accept()


